<template>
  <div class="lab-introduction-page">
    <div class="page-header animate-on-scroll">
      <!-- 页面标题区域 -->
      <div class="page-header">
        <div class="header-content">
          <h1 class="page-title">实验室简介</h1>
          <div class="title-underline"></div>
          <p class="page-subtitle">
            Joint Research Lab on Panoramic Intelligent Surveillance and Multimodal Large Models
          </p>
        </div>
      </div>
    </div>

    <!-- 主要内容区域 -->
    <div class="container">
      <div class="content-wrapper">
        <!-- 左侧内容区域 -->
        <div class="main-content">
          <!-- 实验室概述卡片 -->
          <div class="card overview-card animate-on-scroll">
            <div class="card overview-card">
              <div class="card-header">
                <h2 class="card-title">实验室简介</h2>
                <!-- <div class="card-divider"></div> -->
              </div>
              <div class="card-body">
                <div class="content-placeholder">
                  <p>
                    全景智能安防与多模态大模型联合实验室成立于2025年，隶属于辽宁石油化工大学人工智能与软件学院。实验室长期从事图像/视频处理、多模态大模型、边缘计算及行为识别等前沿方向的研发，致力于打造一个跨学科、高水平的产学研一体化创新平台。实验室目前拥有一支由10余名青年教师与优秀研究生组成的、富有创新活力的科研团队。
                  </p>
                  <p>
                    实验室配备了先进的高性能计算服务器及软硬件设施，致力于构建全方位、智能化的新一代安防技术体系。实验室面向国家在公共安全、智能感知与人工智能领域的重大战略需求，致力于打造一个跨学科、高水平的产学研一体化创新平台。在图像与视频信息处理、机器学习与数据挖掘等研究领域，取得了一批有影响的前沿基础理论研究成果。
                  </p>
                </div>
              </div>
            </div>
          </div>

          <!-- 中间栏 -->
          <div class="sidebar">
            <div class="card info-contact-card animate-on-scroll">
              <!-- 合并后的信息与联系方式卡片 -->
              <div class="card info-contact-card">
                <div class="card-header">
                  <h3 class="card-title">实验室信息</h3>
                </div>
                <div class="card-body">
                  <div class="info-contact-container">
                    <!-- 左侧基本信息 -->
                    <div class="info-section">
                      <h4 class="section-title">基本信息</h4>
                      <div class="info-item">
                        <span class="info-label">成立时间:</span>
                        <span class="info-value">2025年</span>
                      </div>
                      <div class="info-item">
                        <span class="info-label">所属单位:</span>
                        <span class="info-value">辽宁石油化工大学</span>
                      </div>
                      <div class="info-item">
                        <span class="info-label">研究方向:</span>
                        <span class="info-value"
                          ><span>多模态大模型</span><br /><span>动作行为识别</span><br /><span>边缘计算</span></span
                        >
                      </div>
                    </div>

                    <!-- 右侧联系方式 -->
                    <div class="contact-section">
                      <h4 class="section-title">联系方式</h4>
                      <div class="contact-item">
                        <i class="contact-icon">📍</i>
                        <span class="contact-text">地址: 辽宁省抚顺市望花区丹东路西段一号 </span>
                      </div>
                      <div class="contact-item">
                        <i class="contact-icon">📞</i>
                        <span class="contact-text">电话: 17696645664</span>
                      </div>
                      <div class="contact-item">
                        <i class="contact-icon">✉️</i>
                        <span class="contact-text">邮箱: 782049502@qq.com</span>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>

          <!-- 实验室特色卡片 -->
          <div class="card features-card animate-on-scroll">
            <div class="card-header">
              <h2 class="card-title">实验室特色</h2>
              <!-- <div class="card-divider"></div> -->
            </div>
            <div class="card-body">
              <div class="features-grid">
                <div class="feature-item" @click="goTo(item.routerPath)" v-for="(item, index) in features" :key="index">
                  <div class="feature-icon">
                    <img class="icon-placeholder" :src="item.icon" alt="icon" />
                  </div>
                  <h3 class="feature-title">{{ item.title }}</h3>
                  <!-- <p class="feature-description">此处将展示实验室在该领域的研究成果和特色...</p> -->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'LabInstruction',
  data() {
    return {
      features: [
        {
          title: '图像/视频处理与计算机视觉',
          // description: '此处将展示实验室在该领域的研究成果和特色...'
          icon: 'https://media.springernature.com/w215h120/springer-static/image/art%3A10.1038%2Fs41593-022-01202-6/MediaObjects/41593_2022_1202_Fig1_HTML.png',
          routerPath: '/labInstruction/computerVisions'

        },
        {
          title: '多模态大模型与深度学习',
          // description: '此处将展示实验室在该领域的研究成果和特色...'
          icon: 'https://media.springernature.com/w215h120/springer-static/image/art%3A10.1038%2Fs41593-022-01202-6/MediaObjects/41593_2022_1202_Fig1_HTML.png',
          routerPath: '/labInstruction/deepStudy'
        },
        {
          title: '边缘计算与分布式计算',
          // description: '此处将展示实验室在该领域的研究成果和特色...'
          icon: 'https://media.springernature.com/w215h120/springer-static/image/art%3A10.1038%2Fs41586-025-09544-4/MediaObjects/41586_2025_9544_Fig1_HTML.png',
          routerPath: '/labInstruction/edgeComputer'
        },
        {
          title: '动作行为识别与视频理解分析',
          // description: '此处将展示实验室在该领域的研究成果和特色...'
          icon: 'https://media.springernature.com/w215h120/springer-static/image/art%3A10.1038%2Fs41586-025-09544-4/MediaObjects/41586_2025_9544_Fig1_HTML.png',
          routerPath: '/labInstruction/actionRecognition'
        },
        {
          title: '大数据智能处理与分析',
          // description: '此处将展示实验室在该领域的研究成果和特色...'
          icon: 'https://media.springernature.com/w215h120/springer-static/image/art%3A10.1038%2Fs41586-025-09544-4/MediaObjects/41586_2025_9544_Fig1_HTML.png',
          routerPath: '/labInstruction/bigModel'
        },
      ]
    }
  },
  methods: {
    goTo(path) {
      this.$router.push(path);
    },
    // 检查元素是否在视口内
    isInViewport(element) {
      const rect = element.getBoundingClientRect();
      return (
        rect.top <= (window.innerHeight || document.documentElement.clientHeight) * 0.85 &&
        rect.bottom >= 0
      );
    },

    // 处理滚动动画
    handleScrollAnimation() {
      const elements = document.querySelectorAll('.animate-on-scroll');
      elements.forEach(element => {
        if (this.isInViewport(element) && !element.classList.contains('animated')) {
          element.classList.add('animated');
        }
      });
    }
  },
  mounted() {
    // 初始检查一次
    this.handleScrollAnimation();
    // 监听滚动事件
    window.addEventListener('scroll', this.handleScrollAnimation);
  },
  beforeDestroy() {
    // 移除事件监听
    window.removeEventListener('scroll', this.handleScrollAnimation);
  }
}
</script>

<style scoped>
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

.lab-introduction-page {
  min-height: calc(100vh - 160px);
  background-image: url("../assets/img/JPSMAI.png");
  padding: 0px 0px 40px;
}

.page-header {
  /* background: #f8f9fa; */
  color: white;
  padding: 15px 0;
  margin-bottom: 30px;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); */
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  /* text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); */
  color: #ffffff;
}

.title-underline {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #6a11cb, #ce04adbc);
  margin: 0 auto 20px;
  border-radius: 2px;
}

.page-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
  color: #fff;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 150px;
}

.content-wrapper {
  display: flex;
  /* gap: 30px; */
  flex-wrap: wrap;
}

.main-content {
  flex: 1;
  min-width: 300px;
}

.sidebar {
  flex: 1;
  min-width: 300px;
  margin-top: 20px;
}

.card {
  background: white;
  border-radius: 8px; /* 减小圆角半径 */
  box-shadow: 0 4px 12px rgba(137, 62, 195, 0.59); /* 调整阴影大小和透明度 */
  margin-bottom: 20px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.card-header {
  padding: 20px 25px 15px;
  border-bottom: 1px solid #eee;
  background: linear-gradient(90deg, #6a11cb, #7f03ac);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

/* .card-divider {
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, #6a11cb, #2575fc);
  margin-top: 10px;
  border-radius: 3px;
} */

.overview-card .card-body {
  padding: 20px;
}

.content-placeholder p {
  color: #666;
  font-size: 1.1rem;
  margin-left: 20px;
  /* margin-bottom: 20px; */
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.feature-item {
  text-align: center;
  padding: 20px;
  border-radius: 8px;
  background: #f8f9fa;
  transition: all 0.3s ease;
  height: 200px;
  cursor: pointer;
}

.feature-item:hover {
  background: #edf4ff;
  transform: translateY(-3px);
}

.icon-placeholder {
  width: 190px;
  height: 170px;
  background-image: url("../assets/img/back.png");
  /* border-radius: 50%; */
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.feature-title {
  font-size: 1rem;
  font-weight: 400;
  margin: 0 0 10px;
  color: #333;
}

.feature-description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

.info-card .card-body {
  padding: 20px 25px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed #eee;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
  color: #555;
}

.info-value {
  color: #777;
}

.contact-card .card-body {
  padding: 20px 25px;
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px dashed #eee;
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-icon {
  font-size: 1.2rem;
  margin-right: 15px;
  width: 24px;
  text-align: center;
  margin-bottom: 10px;
}

.contact-text {
  color: #555;
  line-height: 2;
}

.contact-text p {
  text-indent: 3em;
  margin: 0 auto;
}

.info-contact-card .card-body {
  padding: 0;
}

.info-contact-container {
  display: flex;
  width: 100%;
}

.info-section,
.contact-section {
  flex: 1;
  padding: 20px 25px;
}

.info-section {
  border-right: 1px solid #eee;
}

/* 新增的分区标题样式 */
.section-title {
  font-size: 1.1rem;
  color: #6a11cb;
  margin-top: 0;
  margin-bottom: 0x;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }

  .content-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .info-item {
    flex-direction: column;
    gap: 5px;
  }

  .info-contact-container {
    flex-direction: column;
  }

  .info-section {
    border-right: none;
    border-bottom: 1px solid #eee;
  }
}
</style>